package my.video.lib.view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JCheckBox;

import my.video.lib.controller.Controller;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class MovieInfo extends JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel buttonPane;
	@SuppressWarnings("unused")
	private Controller controller;
	private MovieInfo movieInfo;
	private JTextField nameTF;
	private JTextField categoryTF;
	private JTextField sizeTF;
	private JTextField pathTF;

	/**
	 * Create the dialog.
	 * @param controller 
	 */
	public MovieInfo(Controller controller) {
		this.controller = controller;
		this.movieInfo = this;
		setTitle("Movie Info");
		setBounds(100, 100, 643, 548);
		{
			buttonPane = new JPanel();
		}
		
		JLabel lblName = new JLabel("Name:");
		
		nameTF = new JTextField();
		nameTF.setEditable(false);
		nameTF.setText(controller.getModel().getXmlPersistenceList().get(controller.getCurrentRow()).getFileName());
		nameTF.setColumns(10);
		
		JLabel lblNewLabel = new JLabel("Pfad:");
		
		JLabel lblNewLabel_1 = new JLabel("Gr\u00F6\u00DFe:");
		
		JLabel lblKategorie = new JLabel("Kategorie:");
		
		categoryTF = new JTextField();
		categoryTF.setEditable(false);
		categoryTF.setColumns(10);
		
		sizeTF = new JTextField();
		sizeTF.setEditable(false);
		sizeTF.setText(controller.getModel().getXmlPersistenceList().get(controller.getCurrentRow()).getFileSizeString());
		sizeTF.setColumns(10);
		
		pathTF = new JTextField();
		pathTF.setEditable(false);
		pathTF.setText(controller.getModel().getXmlPersistenceList().get(controller.getCurrentRow()).getFilePath());
		pathTF.setColumns(10);
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addComponent(buttonPane, GroupLayout.PREFERRED_SIZE, 627, GroupLayout.PREFERRED_SIZE)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(21)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblName)
							.addGap(29)
							.addComponent(nameTF, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(lblKategorie)
								.addComponent(lblNewLabel_1)
								.addComponent(lblNewLabel))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(pathTF, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE)
								.addComponent(sizeTF, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE)
								.addComponent(categoryTF, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE))))
					.addGap(344))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(51)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblName)
						.addComponent(nameTF, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel)
						.addComponent(pathTF, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel_1)
						.addComponent(sizeTF, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblKategorie)
						.addComponent(categoryTF, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(297)
					.addComponent(buttonPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
		);
		buttonPane.setLayout(null);
		getContentPane().setLayout(groupLayout);
	}
}
